From: Simon McVittie Date: Sun, 30 Oct 2016 14:12:02 +0000 (+0000) Subject: ostree_builtin_pull: consistently set free-function on refs_to_fetch X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~44^2~21 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=213d5013cec6abe61c3500c1bffceff1a42d5509;p=ostree.git ostree_builtin_pull: consistently set free-function on refs_to_fetch We are relying on the GPtrArray to free its contents, but we only give it a free-function on one code path. Found by valgrind memcheck. Signed-off-by: Simon McVittie Closes: #559 Approved by: cgwalters --- diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 9f48c2e0..52a55375 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -198,7 +198,7 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** else { char *ref_to_fetch; - refs_to_fetch = g_ptr_array_new (); + refs_to_fetch = g_ptr_array_new_with_free_func (g_free); if (!ostree_parse_refspec (argv[1], &remote, &ref_to_fetch, error)) goto out; /* Transfer ownership */